package com.originalpoint.origin_server.service.Impl;

import com.originalpoint.origin_server.mapper.DishMapper;
import com.originalpoint.origin_server.pojo.Dish;
import com.originalpoint.origin_server.pojo.Dto.BasePageDto;
import com.originalpoint.origin_server.pojo.Dto.DishDto;
import com.originalpoint.origin_server.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishImpl implements DishService {
    @Autowired
    private DishMapper dishMapper;

    @Override
    public int insertAll(Dish dish) {
        return dishMapper.insertAll(dish);
    }

    @Override
    public int deleteByDishId(Integer dishId) {
        return dishMapper.deleteByDishId(dishId);
    }
    @Override
    public int updateDish(Dish dish) {
        return dishMapper.updateDish(dish);
    }

    @Override
    public List<Dish> selectAllDish(DishDto dishDto) {
        return dishMapper.selectAllDish(dishDto);
    }

    @Override
    public int countDish(DishDto dishDto) {
        return dishMapper.countDish(dishDto);
    }

    @Override
    public Dish selectByDishID(Integer dishId) {
        return dishMapper.selectById(dishId);
    }
}
